<extend name="layout" />

<block name="body">
<body>
<include file="banner.block" />
<div class="wh ov">
	<ul class="header_bt">
		<li>
			<a href="{:U('score_log')}">
				<dl><img src="__PUBLIC__/App/images/mall_hd_icon01.png"></dl>
				<dt>
					<span>我的积分</span>
					<font>剩余<b>{$user.score}</b>分</font>
				</dt>
			</a>
		</li>
		<li>
			<a href="{:U('log')}">
				<dl><img src="__PUBLIC__/App/images/mall_hd_icon02.png"></dl>
				<dt>
					<span>兑换记录</span>
					<font>瞧瞧都换了什么</font>
				</dt>
			</a>
		</li>
	</ul>
	<div class="mall_tt">
		<span>热门兑换</span>
	</div>
	<ul class="mall_list_box">
		<volist name="hot" id="vo">
		<li class="<if condition="$i eq 1">img_st1<else />img_st2</if>">
			<a href="{:U('show?id='.$vo['id'])}">
				<div class="img_list_icon"><img src="__PUBLIC__/App/images/mall_list_bg.png"><span>{$vo.type_text}</span></div>
				<dl><img src="{$vo.pics.0}"><span></span></dl>
				<dt>
					<span class="name">{$vo.entity_text}</span>
					<span class="st">{$vo.name}</span>
					<span class="num">{$vo.score} 分</span>
				</dt>
			</a>
		</li>
		</volist>
	</ul>
	<div class="mall_tt">
		<span>精选商品</span>
	</div>
	<ul class="mall_list_box mall_list_box1" id="JS-recomd">
		<volist name="recomd" id="vo">
		<li class="img_st1">
			<a href="{:U('show?id='.$vo['id'])}">
				<div class="img_list_icon"><img src="__PUBLIC__/App/images/mall_list_bg.png"><span>{$vo.type_text}</span></div>
				<dl><img src="{$vo.pics.0}"><span></span></dl>
				<dt>
					<span class="name">{$vo.entity_text}</span>
					<span class="st">{$vo.name}</span>
					<span class="num">{$vo.score} 分</span>
				</dt>
			</a>
		</li>
		</volist>
	</ul>
</div>
</body>
</block>


<block name="script">
<script type="text/javascript">
$(document).ready(function(){

	$(".main_visual").hover(function(){
		$("#btn_prev,#btn_next").fadeIn()
	},function(){
		$("#btn_prev,#btn_next").fadeOut()
	});
	
	$dragBln = false;
	
	$(".main_image").touchSlider({
		flexible : true,
		speed : 200,
		btn_prev : $("#btn_prev"),
		btn_next : $("#btn_next"),
		paging : $(".flicking_con a"),
		counter : function (e){
			$(".flicking_con a").removeClass("on").eq(e.current-1).addClass("on");
		}
	});
	
	$(".main_image").bind("mousedown", function() {
		$dragBln = false;
	});
	
	$(".main_image").bind("dragstart", function() {
		$dragBln = true;
	});
	
	$(".main_image a").click(function(){
		if($dragBln) {
			return false;
		}
	});
	
	timer = setInterval(function(){
		$("#btn_next").click();
	}, 5000);
	
	$(".main_visual").hover(function(){
		clearInterval(timer);
	},function(){
		timer = setInterval(function(){
			$("#btn_next").click();
		},5000);
	});
	
	$(".main_image").bind("touchstart",function(){
		clearInterval(timer);
	}).bind("touchend", function(){
		timer = setInterval(function(){
			$("#btn_next").click();
		}, 5000);
	});
	

});
</script>
</block>